package com.gsa.security.internal;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.cli.ParseException;

import com.gsa.core.RouterCLI;
import com.gsa.core.http.Header;
import com.gsa.core.transport.http.HttpEndpointListener;
import com.gsa.core.transport.http.HttpServerThread;
/**
 * Servlet implementation class SecurityProvider
 */
public class SecurityProvider extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public SecurityProvider() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		doPost(request,response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		

		
		try {
			RouterCLI.initiate();
			Header hd = new Header();
			System.out.println("Divyansh - Content Type"+hd.getContentType());
			@SuppressWarnings("unused")
			Long sd = HttpEndpointListener.currentThread().getId();
			
			System.out.println(HttpServerThread.currentThread().getName());	
			
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

}
